<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>后台管理</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"
          th:href="@{/LoginStyle/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css"
          th:href="@{/LoginStyle/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css"
          th:href="@{/LoginStyle/css/ionicons.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css" th:href="@{/AdminStyle/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect. -->
    <link rel="stylesheet" href="dist/css/skins/skin-blue.min.css" th:href="@{/AdminStyle/css/skin-blue.min.css}">

    <link rel="stylesheet" th:href="@{/AdminStyle/css/example.css}">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
    <style>
        label {
            width: 80px;
        }

        .i-box {
            margin-bottom: 15px;
        }
    </style>
</head>
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <!-- Main Header -->
    <header th:replace="~{/admin/fragment/example :: header}"/>
    <!-- Left side column. contains the logo and sidebar -->
    <aside th:replace="~{/admin/fragment/example :: aside}"/>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                添加管理员
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li class="active">添加管理员</li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content container-fluid">
            <div class="i-box"><label for="adminName">管理员名:</label>
                <input id="adminName" type="text"></div>
            <div class="i-box"><label for="adminPwd">密码:</label>
                <input id="adminPwd" type="password"></div>
            <div class="i-box"><label for="adminPwd2">确认密码:</label>
                <input id="adminPwd2" type="password"></div>
            <div class="i-box"><label for="adminPwd">权限:</label>
                <select id="select">
                    <option value="0">0</option>
                    <option value="1" selected>1</option>
                    <option value="2">2</option>
                </select>
            </div>
            <div class="i-box"><label for="email">邮箱:</label>
                <input id="email" type="email"></div>
            <div class="i-box"><label for="phone">电话号码:</label>
                <input id="phone" type="text"></div>
            <div class="i-box"><label for="Beizhu">备注:</label>
                <textarea id="Beizhu"></textarea>
            </div>
            <div class="i-box"><input type="submit" id="submit" value="提交"></div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <!-- Main Footer -->
    <footer th:replace="~{/admin/fragment/example :: footer}"/>

</div>
<!-- ./wrapper -->
<!-- jQuery 3 -->
<script src="bower_components/jquery/dist/jquery.min.js" th:src="@{/LoginStyle/js/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js" th:src="@{/LoginStyle/js/bootstrap.min.js}"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js" th:src="@{/AdminStyle/js/adminlte.min.js}"></script>
<script th:src="@{/AdminStyle/js/adminHead.js}"></script>
<script>
    $(document).ready(function () {

        $("#submit").click(function () {
            let adminName = $("#adminName").val();
            let adminPwd = $("#adminPwd").val();
            let adminPwd2 = $("#adminPwd2").val();
            let power = $("#select").val();
            let email = $("#email").val();
            let phone = $("#phone").val();
            let BeiZhu = $("#Beizhu").val();
            console.log(adminName + "," + adminPwd + "," + adminPwd2 + "," + power + "," + email + "," + phone + "," + BeiZhu);
            $.post("/Admin/createAdmin/data", {
                adminName: adminName,
                adminPwd: adminPwd,
                adminPwd2: adminPwd2,
                power: power,
                email: email,
                phone: phone,
                remake: BeiZhu
            }, function (data) {
                if (data == "yes") alert("添加成功！");
                else alert(data);
            });
        })
    });

</script>

<!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. -->
</body>
</html>